﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Model
{
    public class T_UserObject
    {
        private System.Int32 db_OID;
        private System.String db_LoginName;
        private System.String db_Password;
        private System.String db_NickName;

        public System.Int32 Db_OID
        {
            get { return db_OID; }
            set { db_OID = value; }
        }
        public System.String Db_LoginName
        {
            get { return db_LoginName; }
            set { db_LoginName = value; }
        }
        public System.String Db_Password
        {
            get { return db_Password; }
            set { db_Password = value; }
        }
        public System.String Db_NickName
        {
            get { return db_NickName; }
            set { db_NickName = value; }
        }

        public void Data2Object(DataRow value)
        {
            if (value["OID"] != DBNull.Value)
                db_OID = System.Int32.Parse(value["OID"].ToString());
            db_LoginName = value["LoginName"].ToString();
            db_Password = value["Password"].ToString();
            db_NickName = value["NickName"].ToString();
        }

        public DataRow Object2Data(ref DataRow value)
        {
            value["OID"] = db_OID;
            value["LoginName"] = db_LoginName;
            value["Password"] = db_Password;
            value["NickName"] = db_NickName;
            return value;
        }
    } // end of class
}
